package com.bjc.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.bjc.service.impl.OrderServiceImpl3;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: spring-cloud-alibaba
 * @description:
 * @author: bjc
 * @create: 2021-08-01 20:14
 */
@RestController
@Slf4j
public class OrderController2 {

    @Autowired
    private OrderServiceImpl3 orderServiceImpl3;

    @RequestMapping("/order/message1")
    public String message1(){
//        orderServiceImpl3.message();
        return "message1";
    }

    @RequestMapping("/order/message2")
    public String message2(){
//        orderServiceImpl3.message();
        return "message2";
    }

    @RequestMapping("/order/message3")
    @SentinelResource("message3")
    public String message3(String name,Integer age){
        return "message3"+name+age;
    }

    @RequestMapping("/order/message4")
    public String message4(){
        return orderServiceImpl3.message();
    }
}
